package com.javaoopone;

import java.util.Scanner;

public class Demo1 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        boolean isOk=true;
         do {
             System.out.print("请输入姓名：\n");
             String uname= scanner.next();
             if(uname.equals("n")){
                 isOk=false;
                 System.out.println("退出程序.");
                 break;
             }
             System.out.print("请输入年龄：\n");
             int age = scanner.nextInt();

             User user = new User();
             user.uName=uname;
             user.age=age;

             user.print();
         }while (isOk);
    }


    /*
    *  User user = new User();
        user.uName="李飞";
        user.age=20;
        user.print();

        User user1 = new User();
        user1.uName="陶一";
        user1.age=5;
        user1.print();
    * */
}
